
<?php  
	/*
	// 基本的json传输
	header('Content-Type:application/json');
	$raw_success =array($_GET["id"],'def',1,array('xyz',56));	
	$res_success = json_encode($raw_success);	
	echo $res_success;
	*/

	//在网址后面给参数id赋值
	header('Content-Type:application/json');
	$con = mysql_connect("localhost","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
$sql_id=$_GET["id"];
	
  
mysql_select_db("test", $con);

$result = mysql_query("SELECT * FROM table01 where id=".$sql_id);

$row = mysql_fetch_array($result);
 

mysql_close($con);
	$raw_success =$row;	
	$res_success = json_encode($raw_success);	
	echo $res_success;
	

?> 
